import { BossConfig } from "../../../resource/BossConfig";
import { SWFPlayer } from "../../../scene/modle/SWFPlayer";
import { ModelUtil } from "../../../scene/player/info/ModelUtil";
import { ModelType } from "../../../scene/modle/data/ModelType";
type int = number;
//class GuildAnimalModelPanel
    
    export  class GuildAnimalModelPanel /* flash.display.Sprite */
    {
        

        public updateModelByCode(arg1: int): void
        {
            var loc1=BossConfig.instance.getInfoByCode(arg1);
            if (this._modellayer == null) 
            {
                this._modellayer = new SWFPlayer();
                this._modellayer.loadComplete = this.onLoadCompleteHandler;
            }
            if (loc1) 
            {
                this._modellayer.load(ModelUtil.getModelSWF(loc1.modelId), ModelType.Monster, loc1);
                this._modellayer.currentDirection = 2;
                if (this.contains(this._modellayer) == false) 
                {
                    this.addChildAt(this._modellayer, 0);
                }
            }
            else 
            {
                this.dispose();
            }
            return;
        }

        /* internal  */onLoadCompleteHandler(arg1: SWFPlayer): void
        {
            this._modellayer.updateCurrentFrame(0);
            this._modellayer.sceneY = 0;
            this.dispatchEvent(new Object /* flash.events.Event */(flash.events.Event.COMPLETE));
            return;
        }

        public dispose(): void
        {
            if (this._modellayer) 
            {
                this._modellayer.dispose();
            }
            return;
        }

        /* internal */ /* var */_modellayer: SWFPlayer;
    }
